package com.cool.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cool.pojo.ClassRoom;
import com.cool.service.ClassRoomService;

import lombok.extern.slf4j.Slf4j;

/**
 * 系统欢迎
 * 
 * @author bian
 * @date 2021-05-27
 */
@RestController
@Slf4j
public class HelloController {
    @Autowired
    private ClassRoomService classRoomService;

    /**
     * 欢迎语
     *
     * @return 文件流
     */
    @GetMapping(value = "/hello")
    public String hello() {
        return "hello world";
    }

    /**
     * 获取班级列表
     * 
     * @return 班级列表
     */
    @GetMapping(value = "/students")
    public List<ClassRoom> students() {
        return classRoomService.selectStudents();
    }
}
